<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/taglibs.jsp"%>

<form action="${ctx}/sys/acl/update" method="post">
    <table>
        <tbody>
            <tr>
                <td><label for="updateform-id">访问控制ID</label></td>
                <td><input type="text" id="updateform-id" name="id" value="${acl.id}" readonly="readonly" class="easyui-textbox"
                        data-options="validType:'length[0,32]', prompt:'不输入时会自动生成'"/>
                </td>
            </tr>
            <tr>
                <td><label for="updateform-principalType">主体类型</label></td>
                <td><input type="text" id="updateform-principalType" name="principalType" value="${acl.principalType}" class="easyui-textbox"
                        data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td><label for="updateform-principalId">主体ID</label></td>
                <td><input type="text" id="updateform-principalId" name="principalId" value="${acl.principalId}" class="easyui-textbox"
                        data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td><label for="updateform-resourceType">资源类型</label></td>
                <td><input type="text" id="updateform-resourceType" name="resourceType" value="${acl.resourceType}" class="easyui-textbox"
                        data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td><label for="updateform-resourceGroup">资源组</label></td>
                <td><input type="text" id="updateform-resourceGroup" name="resourceGroup" value="${acl.resourceGroup}" class="easyui-textbox"
                        data-options="required:true"/>
                </td>
            </tr>
            <tr>
                <td><label for="updateform-aclCode">访问控制码</label></td>
                <td><input type="text" id="updateform-aclCode" name="aclCode" value="${acl.aclCode}" class="easyui-textbox"
                        data-options="required:true, validType:'number'"/>
                </td>
            </tr>
        </tbody>
    </table>
</form>

<script type="text/javascript">
$(function(){
    var $principalType = $('#updateform-principalType');
    var $resourceType = $('#updateform-resourceType');
    $principalType.combogrid({
        url: ctx + '/sys/dict/list-by-field',
        queryParams: {
            field: 'principal_type',
        },
        idField: 'value',
        textField: 'valueDesc',
        rownumbers: true,
        fitColumns: true,
        columns: [[
            {title: '主体类型', field: 'value', sortable: true, width: 100},
            {title: '类型描述', field: 'valueDesc', sortable: true, width: 100}
        ]]
    });
    $resourceType.combogrid({
        url: ctx + '/sys/dict/list-by-field',
        queryParams: {
            field: 'resource_type',
        },
        idField: 'value',
        textField: 'valueDesc',
        rownumbers: true,
        fitColumns: true,
        columns: [[
            {title: '资源类型', field: 'value', sortable: true, width: 100},
            {title: '类型描述', field: 'valueDesc', sortable: true, width: 100}
        ]]
    })
});
</script>